
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.ElectiveResultDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class ElectiveResultDaoJdbc extends BaseDaoJdbc implements ElectiveResultDao {
	String tableName="T_ELECTIVE_RESULT";
	String beanName="electiveResult";
	
	public CommonBean createElectiveResult(){
		CommonBean electiveResults=this.createBean(tableName,beanName);
                return electiveResults;		
	}
	
/*
	public CommonBean findElectiveResults(String refid) {
		CommonBean electiveResults=this.createElectiveResult();
		String sql="select * from T_ELECTIVE_RESULT where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		electiveResults.addData(data);
                return electiveResults;
       }
*/
	public CommonBean findElectiveResultById(String id) {
		CommonBean electiveResults=this.createElectiveResult();
		String sql="select * from T_ELECTIVE_RESULT where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		electiveResults.addData(data);
    return electiveResults;
  }
  
	public CommonBean findAllElectiveResults() {
		CommonBean electiveResults=this.createElectiveResult();
		String sql="select * from T_ELECTIVE_RESULT ";
		List data=this.getCommonDao().select(sql,new String[]{});
		electiveResults.addData(data);
    return electiveResults;
  }
	public void insertElectiveResult(CommonBean electiveResultBean){
		List data=electiveResultBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
}

